package pers.mine.utils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import pers.mine.vo.Info;

/**
 * @author Mine
 * @since 2016年10月20日_上午11:09:23 用于一些po属性简单验证,是否可用等
 */
public class SimpleUtil {
	// 尝试取得request 中indexinfo的信息
	public static Info getIndexInfoWithRequest(HttpServletRequest request) {
		Object obj = request.getAttribute("indexinfo");
		if (obj != null) {
			return (Info) obj;
		}
		return null;
	}

	// 尝试取得session 中indexinfo的信息
	public static Info getIndexInfoWithSession(HttpSession session) {
		Object obj = session.getAttribute("indexinfo");
		if (obj != null) {
			return (Info) obj;
		}
		return null;
	}
}
